Imports Sys = System
Imports Tex = System.Text

Namespace Enhancements.Core.Logging
    ''' <summary>A type of configuration specific to XmlFormatter instances.</summary>
    Public NotInheritable Class XmlFormatterConfiguration
        Inherits FormatterConfiguration

        ''' <summary>Initializes a XmlFormatterConfiguration instance, with default values.</summary>
        Public Sub New()
        End Sub
        ''' <summary>Initializes a XmlFormatterConfiguration instance.</summary>
        ''' <param name="_encoding">Encoding to use by the instance.</param>
        ''' <param name="_indentationUse">IndentationUse to use by the instance.</param>
        ''' <param name="_indentationLength">IndentationLength to use by the instance.</param>
        ''' <param name="_indentationCharacter">IndentationCharacter to use by the instance.</param>
        ''' <exception cref="IsNullException">_encoding is null.</exception>
        ''' <exception cref="IsInRangeNotException">_indentationLength is lower than 0.</exception>
        ''' <exception cref="IsUnicodeWhiteSpaceNotException">_indentationCharacter is invalid.</exception>
        Public Sub New(ByVal _encoding As Tex.Encoding, ByVal _indentationUse As System.Boolean, ByVal _indentationLength As Sys.Int32, ByVal _indentationCharacter As System.Char)
            Encoding = _encoding
            IndentationUse = _indentationUse
            IndentationLength = _indentationLength
            IndentationCharacter = _indentationCharacter
        End Sub

        Private __Encoding As Tex.Encoding = Tex.UTF32Encoding.UTF32
        ''' <summary>Gets and sets the encoding used by the instance. The default value is 'System.Text.UTF32Encoding.UTF32'.</summary>
        ''' <exception cref="IsNullException">The value is null (while setting).</exception>
        Public Property Encoding() As Tex.Encoding
            Get
                Return __Encoding
            End Get
            Set(ByVal _value As Tex.Encoding)
                ___Assert.___IsNullNot("Encoding._value", _value, True)

                __Encoding = _value
            End Set
        End Property

        Private __IndentationUse As System.Boolean = True
        ''' <summary>Gets and sets the value that defines whether indentation should be used by the instance. The default value is 'true'.</summary>
        Public Property IndentationUse() As System.Boolean
            Get
                Return __IndentationUse
            End Get
            Set(ByVal _value As System.Boolean)
                __IndentationUse = _value
            End Set
        End Property

        Private __IndentationLength As Sys.Int32 = 4
        ''' <summary>Gets and sets the number of times the IndentationCharacter should be repeated by the instance. The default value is '4'.</summary>
        ''' <exception cref="IsInRangeNotException">The value is lower than 0 (while setting).</exception>
        Public Property IndentationLength() As Sys.Int32
            Get
                Return __IndentationLength
            End Get
            Set(ByVal _value As Sys.Int32)
                ___Assert.___IsInRange("IndentationLength._value", _value, 0, Sys.Int32.MaxValue, True)

                __IndentationLength = _value
            End Set
        End Property

        Private __IndentationCharacter As System.Char = " "c
        ''' <summary>Gets and sets the character to use for indentation by the instance. The default value is ' '.</summary>
        ''' <exception cref="IsInRangeNotException">The value is invalid (while setting).</exception>
        Public Property IndentationCharacter() As System.Char
            Get
                Return __IndentationCharacter
            End Get
            Set(ByVal _value As System.Char)
                ___Assert.___IsUnicodeWhiteSpace("IndentationCharacter._value", _value, True)

                __IndentationCharacter = _value
            End Set
        End Property

    End Class
End Namespace
